/*     */ package com.umeng.common.net;
/*     */ 
/*     */ import android.app.Notification;
/*     */ import android.app.NotificationManager;
/*     */ import android.app.PendingIntent;
/*     */ import android.content.Context;
/*     */ import android.content.Intent;
/*     */ import android.net.Uri;
/*     */ import android.os.Bundle;
/*     */ import android.os.Handler;
/*     */ import android.os.Message;
/*     */ import com.umeng.common.Log;
/*     */ import com.umeng.common.a.c;
/*     */ import com.umeng.common.b;
/*     */ import com.umeng.common.util.DeltaUpdate;
/*     */ import java.io.File;
/*     */ 
/*     */ class f extends Handler
/*     */ {
/*     */   f(DownloadingService paramDownloadingService)
/*     */   {
/*     */   }
/*     */ 
/*     */   public void handleMessage(Message paramMessage)
/*     */   {
/*     */     a.a locala;
/*     */     int i;
/*     */     Notification localNotification;
/*     */     Object localObject1;
/*     */     Object localObject2;
/* 273 */     switch (paramMessage.what) {
/*     */     case 5:
/* 275 */       locala = (a.a)paramMessage.obj;
/* 276 */       i = paramMessage.arg2;
/*     */       try {
/* 278 */         String str1 = paramMessage.getData().getString("filename");
/*     */ 
/* 280 */         Log.c(DownloadingService.a(), "Cancel old notification....");
/*     */ 
/* 282 */         localNotification = new Notification(
/* 283 */           17301634, 
/* 284 */           DownloadingService.b(this.a).getString(c.j(DownloadingService.b(this.a))), 
/* 285 */           System.currentTimeMillis());
/* 286 */         localObject1 = new Intent("android.intent.action.VIEW");
/* 287 */         ((Intent)localObject1).addFlags(268435456);
/* 288 */         ((Intent)localObject1).setDataAndType(Uri.fromFile(new File(str1)), 
/* 289 */           "application/vnd.android.package-archive");
/* 290 */         localObject2 = PendingIntent.getActivity(DownloadingService.b(this.a), 0, (Intent)localObject1, 
/* 291 */           134217728);
/*     */ 
/* 293 */         localNotification.setLatestEventInfo(DownloadingService.b(this.a), locala.b, 
/* 294 */           DownloadingService.b(this.a).getString(c.j(DownloadingService.b(this.a))), 
/* 295 */           (PendingIntent)localObject2);
/* 296 */         localNotification.flags = 16;
/*     */ 
/* 298 */         DownloadingService.a(this.a, (NotificationManager)this.a.getSystemService("notification"));
/*     */ 
/* 300 */         DownloadingService.c(this.a).notify(i + 1, localNotification);
/*     */ 
/* 302 */         Log.c(DownloadingService.a(), "Show new  notification....");
/*     */ 
/* 304 */         boolean bool = DownloadingService.a(this.a).a(DownloadingService.b(this.a));
/* 305 */         Log.c(DownloadingService.a(), String.format("isAppOnForeground = %1$B", new Object[] { Boolean.valueOf(bool) }));
/*     */ 
/* 311 */         if (bool) {
/* 312 */           DownloadingService.c(this.a).cancel(i + 1);
/* 313 */           DownloadingService.b(this.a).startActivity((Intent)localObject1);
/*     */         }
/*     */ 
/* 316 */         Log.a(DownloadingService.a(), String.format("%1$10s downloaded. Saved to: %2$s", new Object[] { 
/* 317 */           locala.b, str1 }));
/*     */       }
/*     */       catch (Exception localException) {
/* 320 */         Log.b(DownloadingService.a(), "can not install. " + localException.getMessage());
/*     */ 
/* 322 */         DownloadingService.c(this.a).cancel(i + 1);
/*     */       }
/*     */ 
/*     */     case 6:
/* 327 */       locala = (a.a)paramMessage.obj;
/* 328 */       i = paramMessage.arg2;
/* 329 */       String str2 = paramMessage.getData().getString("filename");
/* 330 */       DownloadingService.c(this.a).cancel(i);
/* 331 */       localNotification = new Notification(
/* 332 */         17301633, 
/* 333 */         DownloadingService.b(this.a).getString(c.l(DownloadingService.b(this.a))), 
/* 334 */         System.currentTimeMillis());
/* 335 */       localObject1 = PendingIntent.getActivity(DownloadingService.b(this.a), 0, new Intent(), 
/* 336 */         134217728);
/* 337 */       localNotification.setLatestEventInfo(DownloadingService.b(this.a), 
/* 338 */         b.w(DownloadingService.b(this.a)), 
/* 339 */         DownloadingService.b(this.a).getString(c.l(DownloadingService.b(this.a))), 
/* 340 */         (PendingIntent)localObject1);
/* 341 */       DownloadingService.c(this.a).notify(i + 1, localNotification);
/* 342 */       localObject2 = str2.replace(".patch", ".apk");
/* 343 */       String str3 = DeltaUpdate.a(this.a);
/*     */       d tmp564_561 = DownloadingService.a(this.a); tmp564_561.getClass(); d.b localb = new d.b(tmp564_561, DownloadingService.b(this.a), 
/* 345 */         i, locala, (String)localObject2, DownloadingService.c(), 
/* 346 */         DownloadingService.b());
/* 347 */       localb.execute(new String[] { str3, localObject2, str2 });
/*     */     }
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\umeng_sdk.jar
 * Qualified Name:     com.umeng.common.net.f
 * JD-Core Version:    0.6.2
 */